package com.roc.template.cloud.util;

import com.alibaba.fastjson.JSONObject;

/**
 * @ClassName BasetToken
 * @Description: TODO
 * @Author Administrator
 * @Date 2020/7/29 14 44
 * @Version V1.0
 **/
public class BasetTokenUtils {

    public static AccessTokenBean getParam(JSONObject jsonObject) {
        AccessTokenBean accessTokenBean = new AccessTokenBean();
        if (jsonObject.getBoolean("success")) {
            JSONObject data = jsonObject.getJSONObject("data");
            accessTokenBean.setRefreshToken(data.getString("refreshToken"));
            accessTokenBean.setAccessToken(data.getString("accessToken"));
            accessTokenBean.setExpiredUntil(data.getIntValue("expireIn"));
        }
        return accessTokenBean;
    }

}
